@echo off
echo ====================================
echo       鲸选项目API连接测试脚本
echo ====================================
echo.

echo 1. 测试后端直接访问...
curl -s -w "状态码: %%{http_code}\n" http://8.163.7.12:8080/api/actuator/ping
echo.

echo 2. 测试Nginx代理...
curl -s -w "状态码: %%{http_code}\n" http://8.163.7.12/api/actuator/ping
echo.

echo 3. 测试登录接口（直接访问）...
curl -s -w "状态码: %%{http_code}\n" -X POST ^
  -H "Content-Type: application/json" ^
  -d "{\"phone\":\"13599466634\",\"password\":\"123456\"}" ^
  http://8.163.7.12:8080/api/auth/login
echo.

echo 4. 测试登录接口（Nginx代理）...
curl -s -w "状态码: %%{http_code}\n" -X POST ^
  -H "Content-Type: application/json" ^
  -d "{\"phone\":\"13599466634\",\"password\":\"123456\"}" ^
  http://8.163.7.12/api/auth/login
echo.

echo 5. 检查前端网站...
curl -s -w "状态码: %%{http_code}\n" http://8.163.7.12/
echo.

echo ====================================
echo 测试完成
echo.
echo 如果看到404错误，说明对应的服务不可访问
echo 如果直接访问成功但Nginx代理失败，问题在Nginx配置
echo 如果都失败，问题可能在后端服务或网络
echo ====================================
pause